<template>
  <div class="home tem-box bg-fff oh">
    <div class="contne pr mag-t-100 center" style="margin-top: 3rem;">
       <div class="success-logo">
         <img src="@/img/success.png" />
       </div>
       <div class="f-30 mag-t-30" style="color:#74D17F; font-size:0.4rem">下单成功</div>
       <div v-if="timeOut.time==0" @click="seeData()" class="confirm_btn mag-t-20 f-30">查看结果</div>
       <div v-else class="confirm_btn mag-t-20 f-30">结果查询中 {{timeOut.time}}s</div>
    </div>
  </div>
</template>

<script>
var $th = "";
export default {
  name: "home",
  components: {},
  data() {
    return {
      checked: false,
      sms: "",
      value: "",
      sendData: {
        name: "",
        idCard: "", //身份证号
        bankCard: "", //信用卡卡号
        mobile: "",
        identifyingCode: "",//短信验证码
        serialNumber:"",//	短信授权接口返回唯一串号
        orderNo:""//订单号
      },
      orderJson:{},
      sendCode: {
        type: true,
        box: "",
        time: 60
      },
      timeOut:{ //倒计时
        time:5,
        box:""

      }
    };
  },
  mounted() {
    $th = this;
    $th.orderJson = "";
    $th.timeOut.box =  setInterval(()=>{
       $th.timeOut.time--;
       if($th.timeOut.time==0){
         clearInterval($th.timeOut.box)
       }
     },1000)
    var getSuer =localStorage.getItem("uesrJson");//获取用户基本数据回填
    if(getSuer){ //如果存在缓存回填用户数据
        getSuer = JSON.parse(getSuer);
        $.extend(true,$th.sendData,getSuer);
    }
  },
    methods: {
   async seeData(){ //结果查询
         $th.jumPage('/');
    
    },
    onClickLeft() {},
    check() {
      //规则校验
      if ($th.sendData.name == "") {
        $th.$toast("请输入姓名");
        return false;
      }
      if ($th.sendData.idCard == "") {
        $th.$toast("请输入身份证号");
        return false;
      }
      if ($th.sendData.bankCard == "") {
        $th.$toast("请输入信用卡号");
        return false;
      }
      if ($th.sendData.mobile == "") {
        $th.$toast("请输入预留手机号");
        return false;
      }
      return true;
    },
    onClickRight() {}
  }
};
</script>
<style scoped>
.success-logo img{width: 1.5rem; height: 1.5rem;}
.tem-box{min-height: 100vh; background: #fff;}
.confirm_btn{padding: 5px 20px; background:#fff; border:1px solid #66A5E4 ;border-radius: 30px; color: #66A5E4;display: inline-block;}
</style>
